package com.aaa.aop.service;

import com.aaa.aop.service.impl.OrderService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.annotation.Order;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2022/11/11  21:19
 */
public class Testaop {
    public static void main(String[] args) {
        ApplicationContext app = new ClassPathXmlApplicationContext("spring01.xml");
        //实现了接口，使用了jdk动态代理  bean里面的类型必须是接口 前面也要用接口来接返回值
        IUserService userService = app.getBean(IUserService.class);
        userService.save();

        // 没有实现接口  切面使用了cglib动态代理   （切面就相当于代理类）
        OrderService orderService = app.getBean(OrderService.class);
        orderService.save();
    }
}
